#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QLayout* pLayout = new QBoxLayout(QBoxLayout::TopToBottom, ui->groupBox);
    ui->groupBox->setLayout(pLayout);
    this->pCanvas = new MyCanvas(ui->groupBox);
    pLayout->addWidget(pCanvas);

    connect(ui->btnLimpiar, SIGNAL(clicked()), this, SLOT(limpiar()));
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::limpiar()
{
    qDebug("Entra a limpiar");
    this->pCanvas->nodos=QList<QVector2D>();
    this->pCanvas->contador = 0;
    repaint();
}
